﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Admin.NET.Application.Entity;

/// <summary>
/// 商品实体类
/// </summary>
[SugarTable("base_product", "商品实体类")]
public class ProductEntity : EntityBase {
    /// <summary>
    /// 商品的名称。
    /// </summary>
    [SugarColumn(ColumnDescription = "商品名称", Length = 100, IsNullable = false)]
    public string Name { get; set; }

    /// <summary>
    /// 商品编码。
    /// </summary>
    [SugarColumn(ColumnDescription = "商品编码", Length = 16, IsNullable = true)]
    public string Code { get; set; }
    /// <summary>
    /// 商品的产地。
    /// </summary>
    [SugarColumn(ColumnDescription = "产地", Length = 100, IsNullable = true)]
    public string Origin { get; set; }

    /// <summary>
    /// 商品的原价。
    /// </summary>
    [SugarColumn(ColumnDescription = "原价", DecimalDigits = 2, Length = 10, IsNullable = true)]
    public decimal? OriginalPrice { get; set; }

    /// <summary>
    /// 商品的折扣价（可为空）。
    /// </summary>
    [SugarColumn(ColumnDescription = "折扣价", DecimalDigits = 2, Length = 10, IsNullable = true)]
    public decimal? Price { get; set; }

    /// <summary>
    /// 标签集合的 JSON 字符串，用于数据库存储。
    /// </summary>
    [SugarColumn(ColumnDescription = "标签集合", IsNullable = true, Length = 500)]
    public string TagsJson { get; set; }


    /// <summary>
    /// 商品的描述信息。
    /// </summary>
    [SugarColumn(ColumnDescription = "描述", Length = 200, IsNullable = true)]
    public string Description { get; set; }
    /// <summary>
    /// 商品的网页描述信息。
    /// </summary>
    [SugarColumn(ColumnDescription = "网页描述", Length = 2000, IsNullable = true)]
    public string HtmlContent { get; set; }

    /// <summary>
    /// 商品的生产日期。
    /// </summary>
    [SugarColumn(ColumnDescription = "生产日期", IsNullable = true)]
    public DateTime ProductionDate { get; set; }

    /// <summary>
    /// 商品的保质期（以天为单位）。
    /// </summary>
    [SugarColumn(ColumnDescription = "保质期（天）", IsNullable = true)]
    public int ExpirationDays { get; set; }

    /// <summary>
    /// 商品是否在售状态，默认为 true。
    /// </summary>
    [SugarColumn(ColumnDescription = "是否在售")]
    public bool IsEnabled { get; set; } = true;

    /// <summary>
    /// 商品的图片地址（URL）。
    /// </summary>
    [SugarColumn(ColumnDescription = "图片地址", Length = 2000, IsNullable = true)]
    public string ImageUrls { get; set; }
    /// <summary>
    /// 销量
    /// </summary>
    [SugarColumn(ColumnDescription = "销量", IsNullable = true)]
    public int SaleCount { get; set; }
    /// <summary>
    /// 评分
    /// </summary>
    [SugarColumn(ColumnDescription = "评分", DecimalDigits = 1, Length = 4, IsNullable = true)]
    public decimal? Rating { get; set; }
    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序" , IsNullable = true)]
    public double? OrderNum { get; set; }
    /// <summary>
    /// 浏览量
    /// </summary>
    [SugarColumn(ColumnDescription = "浏览量", IsNullable = true)]
    public int? ViewCount { get; set; }
    /// <summary>
    /// 联系人联系电话集合
    /// </summary>
    [SugarColumn(ColumnDescription = "联系人联系电话集合", Length = 200, IsNullable = true)]
    public string PhoneNumbers { get; set; }

}
